#名称:Backdream
#时间2022/12/20  16:24

from selenium.webdriver.common.by import By
from pages.base_page import BasePage
class LoginPage(BasePage):
    #地址
    url = "/crm"
    # 用户名定位
    name_locator = (By.NAME, "name")
    # 密码定位器
    passwd_locator = (By.NAME, "password")
    # 登录按钮定位器
    login_btn = (By.NAME, "submit")

    #输入用户名
    def input_username(self,username):
        self.driver.find_element(*self.name_locator).send_keys(username)
    #输入密码
    def input_passwd(self,password):
        self.driver.find_element(*self.passwd_locator).send_keys(password)
    #点击登录
    def click_login(self):
        self.driver.find_element(*self.login_btn).click()

